from urllib import request


def dl_url(url):
    headers = {
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36'}
    req = request.Request(url, headers=headers)
    with request.urlopen(req) as file:
        raw_data = file.read()
        try:
            data = raw_data.decode('utf-8')
        except UnicodeDecodeError:
            data = raw_data.decode('gbk')
        return data
